#include <iostream>
#include <memory>//unique_ptr
#include "PollServer.hpp"

int main(int argc,char *argv[])
{
    //通过可变参数传进 port
    if(argc != 2)
    {
        // lg.LogMessage(Error,"\n\t./select port\n");
        std::cout << "Usage: " << argv[0] << " port\n" << std::endl;
        return 1;
    }
    
    uint16_t localport = std::stoi(argv[1]);//将字符串

    std::unique_ptr<PolltServer> svr = std::make_unique<PolltServer>(localport);

    svr->InitServer();

    svr->loop();

    return 0;
}